library(tidyverse)
library(sf) # For spatial data
library(mapview) # To quickly map

Data availability statement

The dataset for this activity is available in the file gull_6tags_data.csv shared via Github (https://github.com/MarieAugerMethe/CANSSI_HMM_wk_dthon_2025). It cannot be used for publication/research without written permission. Please contact Marie Auger-Méthé () for more information.

Description of the dataset

The dataset contains the data of six glaucous-winged gulls, tagged on an island located off the coast of Vancouver Island. The data covers a period of one month in July 2023. It includes speed, GPS, and acceleration data.

# Read data
gulls <- read.csv("gull_6tags_data.csv")
# Format columns
gulls$UTC_datetime <- ymd_hms(gulls$UTC_datetime)
gulls$device_id <- as.factor(gulls$device_id)
head(gulls)
##   device_id        UTC_datetime Latitude Longitude speed_km.h acc_x acc_y acc_z
## 1    223280 2023-07-01 00:01:32 48.63405 -123.2886          0   -70  -542   900
## 2    223280 2023-07-01 00:16:36 48.63340 -123.2858          0  -107  -696   773
## 3    223280 2023-07-01 00:31:45 48.63330 -123.2869          1   -20  -678   813
## 4    223280 2023-07-01 00:47:05 48.63304 -123.2837          3   -30    98   868
## 5    223280 2023-07-01 01:01:33 48.63211 -123.2832          0    90  -612   836
## 6    223280 2023-07-01 01:16:39 48.63205 -123.2831          0    69  -734   797
##   toxoplasmosis
## 1             0
## 2             0
## 3             0
## 4             0
## 5             0
## 6             0

The data was collected approximately every 15 minutes, though some times may be missing. This will need to be accounted for.

As you can see, the dataset contains these variables:

Quick visualization

Let’s map the movement of the gulls

gulls_sf <- st_as_sf(gulls %>% filter(!is.na(Longitude)), coords = c("Longitude","Latitude"), remove=FALSE)
st_crs(gulls_sf) <- 4326 #Coordinate system: WGS 84

mapview(gulls_sf, zcol = "device_id",
        layer.name=" ")

Let’s look at the change in speed through time.

plot_speed <- ggplot(data = gulls) +
  geom_line(aes(x = UTC_datetime, y = speed_km.h, colour = device_id)) 
plot_speed

Datathon goal

The goals are (1) to provide a road map of how to tackle the questions listed below, (2) attempt to complete at least the first step of your road map, and (3) provide interpretation of the results. Make a quick 5-minute presentation explaining what your team did.

Questions:

The general goal is to understand what whether toxoplasmosis affects the activity patterns of the gulls and in general better understanding the behavioural patterns of these animals. Specifically, we can address the following questions:

  • Is the transition probability between behavioural states different between infected and uninfected gulls?
  • Can we identify diurnal and weekly patterns?

Three hidden states we may be interested in identifying could be: flying, swimming, and resting

Things to think about: There may be missing data.

Acknowledgments

If the analysis you developed with your team, or a derivative of it, is used in your thesis or in a publication, please add the name of our research team and of your teammates in the acknowledgements. Please also let Marie Auger-Méthé () and Vianey Leos Barajas () know, as we will be excited to see that our datathon has provided you with concrete help! The name of our team is: CANSSI: Advancing Statistical Methods for the Analysis of Complex Biologging Data Collected from Humans and Animals.